home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 April / Chip CMCD0400.iso / SOFTWARE / Demo / InfoPulse / GateKeeper / gk3full.exe / data1.cab / ConfigSite_Files / rules / rule.agp < prev    next >
Encoding:
Text File  |  1999-06-17  |  5.0 KB  |  217 lines

  1. <%
  2.     On Error Resume Next
  3.     ruleName = Request.ReqParam("rule")
  4.     if( ruleName = "" ) then
  5.         nou = True
  6.     else
  7.         nou = False
  8.         action = Request.ReqParam("action")
  9.         if( action = "" ) then
  10.             Set rule = Rules.item(ruleName)
  11.         else
  12.             if( action = "Remove" ) then
  13.                 Set rule = Rules.item(ruleName)
  14.                 rule.Remove
  15.                 Response.Redirect("/rules/managerules.agp")
  16.             end if
  17.             if( action = "Commit" ) then
  18.                 Set rule = Rules.NewRule
  19.                 rule.Name = ruleName
  20.                 rule.Commit
  21.                 Response.Redirect("/rules/rule.agp?rule=" + ruleName)
  22.             end if
  23.         end if
  24.     end if
  25. %>
  26. <html>
  27. <head>
  28. <meta NAME="Author,Design" Content="GateKeeper Team; gatekeeper@infopulse.net">
  29. <meta NAME="Copyright" Content="Infopulse; www.infopulse.net">
  30. <title>Empty</title>
  31. </head>
  32.  
  33. <body bgcolor="#FFFFFF" text="#000000">
  34. <%
  35.     if nou = False then
  36.         Set Users = Accounts.Users
  37.         On Error Resume Next
  38.         Set user = Users.item( ruleName )
  39.         If Not Err.Number = 0 Then 
  40.             szType = "group"
  41.             Err.Number = 0
  42.         else
  43.             szType = "user"
  44.         End If
  45. %>
  46.     <p><big><strong><font face="Arial">
  47.         Rules for <%Response.Write(szType)%> <%Response.Write(ruleName)%>
  48.     </font></strong></big></p>
  49. <%
  50.     End if
  51. %>
  52.  
  53. <%
  54.     if Not Err.Number = 0 Then
  55.         Response.Write("<B><FONT COLOR=""#FF0000"">" & Err.Description & ": " & ruleName & "</FONT></B><br>")
  56.     end if
  57. %>
  58. <%
  59.    if nou = False then
  60. %>
  61.  
  62.     <div>
  63.     <table border="1" cellpadding="0" cellspacing="0" width="60%">
  64.    <tr>
  65.         <td width="40%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  66.             Time scheduling on protocols
  67.         </font></strong></td>
  68.    </tr>
  69.   <%
  70.     for i = 1 to rule.CountProtocols
  71.         protName = rule.GetProtocolName(i)
  72.         link = "<a href=""protocoledit.agp?rule=" & ruleName & "&protocol=" & protName & """>" & protName & "</a>"
  73.   %>
  74.    <tr>
  75.         <td width="50%"><font face="Arial">
  76.              
  77.             <%Response.Write(link)%>
  78.         <font></td>
  79.    </tr>
  80.   <%
  81.     next
  82.   %>
  83.    </table></div>
  84.    <font face="Arial">
  85.   <%
  86.     link = "<a href=""protocoledit.agp?rule=" & ruleName & """>Add new time scheduling rule</a>"
  87.     Response.Write(link)
  88.   %>
  89.   </font>
  90.    <p>
  91.    <hr width="60%" align="left">
  92.    <br>
  93.    <div>
  94.     <table border="1" cellpadding="0" cellspacing="0" width="60%">
  95.    <tr>
  96.         <%
  97.             if rule.SitesPermitted then
  98.                 msg = "All sites are DENIED, excepting these:"
  99.             else
  100.                 msg = "All sites are ALLOWED, excepting these:"
  101.             end if
  102.         %>
  103.         <td width="50%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  104.             <%Response.Write(msg)%>
  105.         </font></strong></td>
  106.    </tr>
  107.   <%
  108.     for i = 1 to rule.CountSites
  109.         site = rule.GetSite(i)
  110.         link = "<a href=""siteedit.agp?rule=" & ruleName & "&site=" & site & """>" & site & "</a>"
  111.   %>
  112.    <tr>
  113.         <td width="50%"><font face="Arial">
  114.              
  115.             <%Response.Write(link)%>
  116.         </font></td>
  117.    </tr>
  118.   <%
  119.     next
  120.   %>
  121.    </table></div>
  122. <font face="Arial">
  123. <a href="siteedit.agp?rule=<%Response.Write(ruleName)%>">Add new site</a>
  124. <form method="POST" action= "siteedit.agp">
  125.     Press this button to
  126.     <input type="hidden" name="rule" value="<%Response.Write(ruleName)%>">
  127.     <%
  128.         if rule.SitesPermitted then
  129.     %>
  130.             <input type="submit" name="action" value="Allow">
  131.     <%
  132.         else
  133.     %>
  134.             <input type="submit" name="action" value="Deny">
  135.     <%
  136.         end if
  137.     %>
  138.     access to all sites except those listed above.
  139. </form>
  140.  
  141. </font>
  142. <p>
  143. <hr width="60%" align="left">
  144.    <form method="POST" action= "/rules/rule.agp">
  145.     <input type="hidden" name="rule" value="<%Response.Write(ruleName)%>">
  146.     <font face="Arial">Press
  147.     <input type="submit" name="action" value="Remove">
  148.     in order to delete all of the rules for this user/group.</font>
  149. <%
  150.     else
  151.         sType = Request.ReqParam("type")
  152. %>
  153.     <p><big><strong><font face="Arial">Add rule</font></strong></big></p>
  154.  
  155.    <form method="POST" action= "/rules/rule.agp">
  156.     <div>
  157.     <table border="1" cellpadding="0" cellspacing="0" width="60%">
  158.    <tr>
  159.         <td width="50%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  160.             Option
  161.         </font></strong></td>
  162.         <td width="50%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  163.             Value
  164.         </font></strong></td>
  165.     </tr>
  166.     <tr>
  167.         <td width="50%"><strong><font face="Arial">
  168.             for <%Response.Write(sType)%>:
  169.         </font></strong></td>
  170.         <td width="50%">
  171.              
  172.             <select name="rule" size="1">
  173. <%
  174.             if sType = "group" Then
  175.                 Set tmpObj = Accounts.groups
  176.             Else
  177.                 Set tmpObj = Accounts.users
  178.             End if
  179.             for i = 1 to tmpObj.count
  180.                 Set tmpObj2 = tmpObj.item(i)
  181. %>
  182.                 <option value="<%Response.Write(tmpObj2.Name)%>"><%Response.Write(tmpObj2.Name)%></option>
  183. <%
  184.             next
  185. %>
  186.             </select>
  187.         </td>
  188.    </tr>
  189.    </table></div>
  190.    <br>
  191. <%
  192.     nr = tmpObj.count
  193.     if nr > 0 Then
  194. %>
  195.         <input type="submit" name="action" value="Commit">
  196. <%
  197.     Else
  198. %>
  199.     <font face="Arial">
  200. <%
  201.     Response.Write("There are no groups defined")
  202. %>
  203.     </font>
  204. <%
  205.     End if
  206. %>
  207.    </form>
  208. <%
  209.    end if
  210. %>
  211. <br>
  212. <br>
  213. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  214. <br>
  215. </body>
  216. </html>
  217.